// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_MST_PERSON
// * CreateDate    : 2011/11/16 10:36:34
// * Creater       : CodeSmith
// * LastChangeDate: 2011/11/16 10:36:34
// * LastChanger   : 2011/11/16 10:36:34
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;

namespace ESOL.Common.Entity
{
	[Serializable]
	public partial class MstPersonEntity : EntityBase
    {
        public MstPersonTable TableSchema
        {
            get
            {
                return MstPersonTable.Current;
            }
		}
		
		public MstPersonEntity()
        {

        }
		
		public MstPersonEntity(DataRow dr)
        {
			if(dr == null)
			{
				return;
			}
			this.PersonId = Convert.ToString(CommonFunctions.ToObject(dr["PERSON_ID"]));
			this.DepartmentId = Convert.ToString(CommonFunctions.ToObject(dr["DEPARTMENT_ID"]));
			this.PositionId = Convert.ToString(CommonFunctions.ToObject(dr["POSITION_ID"]));
			this.Supervisor = Convert.ToString(CommonFunctions.ToObject(dr["SUPERVISOR"]));
			this.PersonCode = Convert.ToString(CommonFunctions.ToObject(dr["PERSON_CODE"]));
			this.NameCn = Convert.ToString(CommonFunctions.ToObject(dr["NAME_CN"]));
			this.NameEn = Convert.ToString(CommonFunctions.ToObject(dr["NAME_EN"]));
			this.Gender = Convert.ToString(CommonFunctions.ToObject(dr["GENDER"]));
			this.Birthday = Convert.ToString(CommonFunctions.ToObject(dr["BIRTHDAY"]));
			this.Country = Convert.ToString(CommonFunctions.ToObject(dr["COUNTRY"]));
			this.Province = Convert.ToString(CommonFunctions.ToObject(dr["PROVINCE"]));
			this.City = Convert.ToString(CommonFunctions.ToObject(dr["CITY"]));
			this.Address = Convert.ToString(CommonFunctions.ToObject(dr["ADDRESS"]));
			this.Email = Convert.ToString(CommonFunctions.ToObject(dr["EMAIL"]));
			this.Mobile = Convert.ToString(CommonFunctions.ToObject(dr["MOBILE"]));
			this.Telephone = Convert.ToString(CommonFunctions.ToObject(dr["TELEPHONE"]));
			this.Status = Convert.ToString(CommonFunctions.ToObject(dr["STATUS"]));
			this.AdvanceAmount = Convert.ToDecimal(CommonFunctions.ToObject(dr["ADVANCE_AMOUNT"]));
			this.LastModifiedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["LAST_MODIFIED_DATE"]));
			this.LastModifiedBy = Convert.ToString(CommonFunctions.ToObject(dr["LAST_MODIFIED_BY"]));
            this.Attachment = Convert.ToString(CommonFunctions.ToObject(dr["ATTACHMENT"]));
        }
		
		public MstPersonEntity(DataRowView dr)
        {
			if(dr == null)
			{
				return;
			}
			this.PersonId = Convert.ToString(CommonFunctions.ToObject(dr["PERSON_ID"]));
			this.DepartmentId = Convert.ToString(CommonFunctions.ToObject(dr["DEPARTMENT_ID"]));
			this.PositionId = Convert.ToString(CommonFunctions.ToObject(dr["POSITION_ID"]));
			this.Supervisor = Convert.ToString(CommonFunctions.ToObject(dr["SUPERVISOR"]));
			this.PersonCode = Convert.ToString(CommonFunctions.ToObject(dr["PERSON_CODE"]));
			this.NameCn = Convert.ToString(CommonFunctions.ToObject(dr["NAME_CN"]));
			this.NameEn = Convert.ToString(CommonFunctions.ToObject(dr["NAME_EN"]));
			this.Gender = Convert.ToString(CommonFunctions.ToObject(dr["GENDER"]));
			this.Birthday = Convert.ToString(CommonFunctions.ToObject(dr["BIRTHDAY"]));
			this.Country = Convert.ToString(CommonFunctions.ToObject(dr["COUNTRY"]));
			this.Province = Convert.ToString(CommonFunctions.ToObject(dr["PROVINCE"]));
			this.City = Convert.ToString(CommonFunctions.ToObject(dr["CITY"]));
			this.Address = Convert.ToString(CommonFunctions.ToObject(dr["ADDRESS"]));
			this.Email = Convert.ToString(CommonFunctions.ToObject(dr["EMAIL"]));
			this.Mobile = Convert.ToString(CommonFunctions.ToObject(dr["MOBILE"]));
			this.Telephone = Convert.ToString(CommonFunctions.ToObject(dr["TELEPHONE"]));
			this.Status = Convert.ToString(CommonFunctions.ToObject(dr["STATUS"]));
			this.AdvanceAmount = Convert.ToDecimal(CommonFunctions.ToObject(dr["ADVANCE_AMOUNT"]));
			this.LastModifiedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["LAST_MODIFIED_DATE"]));
			this.LastModifiedBy = Convert.ToString(CommonFunctions.ToObject(dr["LAST_MODIFIED_BY"]));
            this.Attachment = Convert.ToString(CommonFunctions.ToObject(dr["ATTACHMENT"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return MstPersonTable.Current;
            }
        }
		
		#region Perporty List
        public string PersonId
        {
            get { return Convert.ToString(GetData(MstPersonTable.C_PERSON_ID)); }
            set { SetData(MstPersonTable.C_PERSON_ID, value); }
        }
		
        public string DepartmentId
        {
            get { return Convert.ToString(GetData(MstPersonTable.C_DEPARTMENT_ID)); }
            set { SetData(MstPersonTable.C_DEPARTMENT_ID, value); }
        }
		
        public string PositionId
        {
            get { return Convert.ToString(GetData(MstPersonTable.C_POSITION_ID)); }
            set { SetData(MstPersonTable.C_POSITION_ID, value); }
        }
		
        public string Supervisor
        {
            get { return Convert.ToString(GetData(MstPersonTable.C_SUPERVISOR)); }
            set { SetData(MstPersonTable.C_SUPERVISOR, value); }
        }
		
        public string PersonCode
        {
            get { return Convert.ToString(GetData(MstPersonTable.C_PERSON_CODE)); }
            set { SetData(MstPersonTable.C_PERSON_CODE, value); }
        }
		
        public string NameCn
        {
            get { return Convert.ToString(GetData(MstPersonTable.C_NAME_CN)); }
            set { SetData(MstPersonTable.C_NAME_CN, value); }
        }
		
        public string NameEn
        {
            get { return Convert.ToString(GetData(MstPersonTable.C_NAME_EN)); }
            set { SetData(MstPersonTable.C_NAME_EN, value); }
        }
		
        public string Gender
        {
            get { return Convert.ToString(GetData(MstPersonTable.C_GENDER)); }
            set { SetData(MstPersonTable.C_GENDER, value); }
        }
		
        public string Birthday
        {
            get { return Convert.ToString(GetData(MstPersonTable.C_BIRTHDAY)); }
            set { SetData(MstPersonTable.C_BIRTHDAY, value); }
        }
		
        public string Country
        {
            get { return Convert.ToString(GetData(MstPersonTable.C_COUNTRY)); }
            set { SetData(MstPersonTable.C_COUNTRY, value); }
        }
		
        public string Province
        {
            get { return Convert.ToString(GetData(MstPersonTable.C_PROVINCE)); }
            set { SetData(MstPersonTable.C_PROVINCE, value); }
        }
		
        public string City
        {
            get { return Convert.ToString(GetData(MstPersonTable.C_CITY)); }
            set { SetData(MstPersonTable.C_CITY, value); }
        }
		
        public string Address
        {
            get { return Convert.ToString(GetData(MstPersonTable.C_ADDRESS)); }
            set { SetData(MstPersonTable.C_ADDRESS, value); }
        }
		
        public string Email
        {
            get { return Convert.ToString(GetData(MstPersonTable.C_EMAIL)); }
            set { SetData(MstPersonTable.C_EMAIL, value); }
        }
		
        public string Mobile
        {
            get { return Convert.ToString(GetData(MstPersonTable.C_MOBILE)); }
            set { SetData(MstPersonTable.C_MOBILE, value); }
        }
		
        public string Telephone
        {
            get { return Convert.ToString(GetData(MstPersonTable.C_TELEPHONE)); }
            set { SetData(MstPersonTable.C_TELEPHONE, value); }
        }
		
        public string Status
        {
            get { return Convert.ToString(GetData(MstPersonTable.C_STATUS)); }
            set { SetData(MstPersonTable.C_STATUS, value); }
        }
		
        public decimal AdvanceAmount
        {
            get { return Convert.ToDecimal(GetData(MstPersonTable.C_ADVANCE_AMOUNT)); }
            set { SetData(MstPersonTable.C_ADVANCE_AMOUNT, value); }
        }
		
        public DateTime LastModifiedDate
        {
            get { return Convert.ToDateTime(GetData(MstPersonTable.C_LAST_MODIFIED_DATE)); }
            set { SetData(MstPersonTable.C_LAST_MODIFIED_DATE, value); }
        }
		
        public string LastModifiedBy
        {
            get { return Convert.ToString(GetData(MstPersonTable.C_LAST_MODIFIED_BY)); }
            set { SetData(MstPersonTable.C_LAST_MODIFIED_BY, value); }
        }
        public string Attachment
        {
            get { return Convert.ToString(GetData(MstPersonTable.C_ATTACHMENT)); }
            set { SetData(MstPersonTable.C_ATTACHMENT, value); }
        }

		#endregion
	}
	
	
}	

